package com.esri.core.tasks.geocode;

import com.esri.core.internal.util.d;
import com.esri.core.io.EsriServiceException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class LocatorFieldInfo {
    private String alias;
    private String name;
    private boolean required;
    private String type;

    public String getName() {
        return this.name;
    }

    public String getAlias() {
        return this.alias;
    }

    public boolean isRequired() {
        return this.required;
    }

    public String getType() {
        return this.type;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static LocatorFieldInfo fromJson(JsonParser jsonParser) throws Exception {
        if (!d.c(jsonParser)) {
            throw new EsriServiceException("This response cannot be parsed.");
        }
        LocatorFieldInfo locatorFieldInfo = new LocatorFieldInfo();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("name".equals(currentName)) {
                locatorFieldInfo.name = jsonParser.getText();
            } else if ("alias".equals(currentName)) {
                locatorFieldInfo.alias = jsonParser.getText();
            } else if ("required".equals(currentName)) {
                locatorFieldInfo.required = jsonParser.getBooleanValue();
            } else if ("type".equals(currentName)) {
                locatorFieldInfo.type = jsonParser.getText();
            } else {
                jsonParser.skipChildren();
            }
        }
        return locatorFieldInfo;
    }

    public String toString() {
        return "LocatorFieldInfo [alias=" + this.alias + ", name=" + this.name + ", required=" + this.required + ", type=" + this.type + "]";
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setName(String str) {
        this.name = str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setAlias(String str) {
        this.alias = str;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setRequired(boolean z) {
        this.required = z;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void setType(String str) {
        this.type = str;
    }
}
